#include <iostream>
#include <sstream>
#include <string>
#include <memory>
#include <jsoncpp/json/json.h>

int main()
{
    const char *name = "jou";
    int age = 18;
    float score[] = {67.6, 77.5, 88}; 
    
    Json::Value root;
    root["name"] = name;
    root["age"] = age;
    
    for(int i = 0; i < 3; i++) {
        root["score"].append(score[i]);
    }
    
    
    Json::StreamWriterBuilder writerBuilder;
    std::unique_ptr<Json::StreamWriter> writer(writerBuilder.newStreamWriter());
    std::stringstream ss;
    
   
    if(writer->write(root, &ss) != 0) {
        std::cerr << "Failed to generate JSON output!" << std::endl;
        return 1;
    }
    
    std::cout << ss.str() << std::endl;
    return 0;
}
